﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;

namespace MyOA.BLL
{
    public class FileMainManage
    {
        FileMainService service = new FileMainService();

        /// <summary>
        /// 根据parentId来获取文件信息
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns>文件信息</returns>
        public IList<FileInfo> getFileInfoByParentId(int parentId)
        {
            return service.getFileInfoByParentId(parentId);
        }

        /// <summary>
        /// 根据文件ID找此文件的路径
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <returns>文件路径</returns>
        public string getFilePathByFileId(int fileId)
        {
            return service.getFilePathByFileId(fileId);
        }

        /// <summary>
        /// 根据文件ID 来修改文件信息表中的是否删除那个字段
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <returns>是否修改成功</returns>
        public bool updateIfDeleteByFileId(int fileId)
        {
            return service.updateIfDeleteByFileId(fileId);
        }

        /// <summary>
        /// 根据文件ID找文件类型ID
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <returns>文件类型ID</returns>
        public int getFileTypeIdByFileId(int fileId)
        {
            return service.getFileTypeIdByFileId(fileId);
        }
    }
}
